// home页面
import React, { Component } from 'react';
import {
    StyleSheet,
    Text,
    View,
    Image,
    TouchableHighlight,
    TouchableOpacity,
    Navigator,
    LayoutAnimation
} from 'react-native';

import Page1 from './Page1';
import Page2 from './Page2';
//var Icon=require('react-native-vector-icons/Ionicons');


export default class Home extends Component {
    constructor(props){
        super(props);
        this.state = {

        }

    }

    render() {
        return (
            <View style={styles.container}>
                <TouchableHighlight
                    onPress={()=>this.props.navigator.push({
                                    sceneConfig: Navigator.SceneConfigs.FloatFromRight,
                                    component: Page1,
                                    params:{
                                        name: 'Page1页面'
                                    }
                                })}
                >
                    <View>
                        {/*<Icon name="ios-home" size={30} color="#900" />*/}
                        <Text style={[styles.page1,styles.font]}>跳转到Page1页面</Text>
                    </View>

                </TouchableHighlight>
                <TouchableHighlight
                    onPress={()=>this.props.navigator.push({
                                    sceneConfig: Navigator.SceneConfigs.FloatFromRight,
                                    component: Page2,
                                    params:{
                                        name: 'Page2页面'
                                    }
                                })}
                >
                    <View>
                        {/*<Icon name="ios-home" size={30} color="#900" />*/}

                        <Text style={[styles.page2,styles.font]}>跳转到Page2页面</Text>
                    </View>
                </TouchableHighlight>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5FCFF',
    },
    page1:{
        backgroundColor:'chocolate'
    },
    page2:{
        backgroundColor:'deeppink'
    },
    font:{
        fontSize:20
    }

});
